<template>
    <div class="ma">
        <common-header></common-header>
        <m-header></m-header>
        <main>
            <common-banner  :banner="banner"></common-banner>
            <common-nav></common-nav>
            <div class="con_box">
                <router-view></router-view>
            </div>
        </main>
        <common-footer></common-footer>
    </div>
</template>
<script>
import CommonHeader from '@/components/commonheader'
import mHeader from '@/components/mobilenav'
import CommonFooter from '@/components/commonfooter'
import CommonBanner from '@/components/commonBanner'
import commonNav from '@/components/commonNav'
export default {
    data(){
        return{
            banner:[],
            ismobile:false,
            wid:''
        };
    },
    created(){
            this.wid = document.body.clientWidth
            if(this.wid<900){
            this.ismobile = true
            this.getmobile()
            }else{
                this.getdata()
                this.ismobile = false
            }
        },
    mounted(){
    },
    watch:{
        
    },
    methods:{
        getdata(){
                this.$api.post('getAdList',{
                    "sort":"sort",
                    "limit":100, 
                    "group":"双带头工作室banner" 
                }).then(res=>{
                    this.banner = res.data.list
                })
            },
            getmobile(){
                this.$api.post('getAdList',{
                    "sort":"sort",
                    "limit":100, 
                    "group":"双带头工作室banner手机端" 
                }).then(res=>{
                    this.banner = res.data.list
                })
            },
    },
    components:{
        CommonBanner,
        CommonFooter,
        CommonHeader,
        commonNav,
        mHeader
    }
}
</script>
<style lang="scss" scoped>
.con_box{
    width: 1200px;
    margin: 0 auto;
}
@media screen and (max-width: 900px) {
    .con_box{
        width: 100%;
        margin: 0 auto;
        padding: 0 .3rem;
        box-sizing: border-box;
    }
    .ma{
        padding-bottom: 1.2rem;
    }
}
</style>